#ifndef ROSharedObject_H
#define ROSharedObject_H

#include <QObject>
#include <QtQmlIntegration>

#include "ROSyncProperty.h"

class DxSOPropertyObserver;

//共享对象，在上面定义的属性会在客户端和服务端之间同步

class ROSharedObject:public ROSyncProperty
{
    Q_OBJECT
    QML_NAMED_ELEMENT(ROSharedObject)
public:
public:
    ROSharedObject(QObject* parent = nullptr);

protected:
    void initialize() override;
    QStringList allProperties() override;
    QVariantMap extractProperties(const QStringList& prop) override;
    void handleProperties(const QVariantMap& var) override;
    void updateTargetProperty(QObject *target, const QString &propName, const QVariant &value);
private:
    void observeAllProperty();
};

#endif
